package com.xzx.shop_front_api.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xzx.shop_front_api.entity.Banner;
import com.xzx.shop_front_api.entity.Messages;
import com.xzx.shop_front_api.mapper.BannerMapper;
import com.xzx.shop_front_api.mapper.MessageMapper;
import com.xzx.shop_front_api.service.BannerService;
import com.xzx.shop_front_api.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BannerServiceImpl implements BannerService {
    @Autowired
    private BannerMapper bannerMapper;
    @Override
    public List<Banner> bannerList(int size) {
        QueryWrapper<Banner> queryWrapper = new QueryWrapper<>();
        queryWrapper.orderByAsc("sort_num");
        queryWrapper.last("limit "+size);
        return bannerMapper.selectList(queryWrapper);
    }
}
